import sys


if __name__ == '__main__':
    line_1 = sys.stdin.readline().strip()
    line_1 = line_1.split(' ')
    n, k = line_1[0], line_1[1]
    matrix = []
    for _ in range(int(line_1[0])):
        x = sys.stdin.readline().strip()
        x = x.split(' ')
        matrix.append(x)
    print(-1)
